import bcrypt from "bcrypt"

//字符串长度
const salt = 10;

//加密hash
export const pwdHash = (pwd: string): Promise<string> => {
    return bcrypt.hash(pwd, salt);
}

//验证hash
export const pwdCompare = (pwd: string, encrypted: string): Promise<boolean> => {
    return bcrypt.compare(pwd, encrypted);
}